/*
 * node.h -- this file is part of mISPL.
 * Copyright (C) 2011 Christian Krause
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
#ifndef NODE_H_
#define NODE_H_

#include "sequence.h"

#define NODE_INIT_MAXSIZE 16

/*** Node data type ***/
typedef struct __node __node_s;
typedef __node_s* node_t;
struct __node {
	int size;
	int maxsize;
	mpz_t* values;
	bool_t* periods;
	node_t children;
};

/*** Node functions ***/
node_t	node_init(int maxsize);
node_t	node_get_child(node_t parent, mpz_t value, bool_t period);
node_t	node_add_child(node_t parent, mpz_t value, bool_t period);
node_t	node_add_sequence(node_t parent, sequence_t sequence);
void	node_clear(node_t node);
void	node_clear_all(node_t node);

#endif /* NODE_H_ */
